package com.simplefaith.delisty.component;

import java.util.ArrayList;
import java.util.List;

import android.app.Activity;
import android.content.Context;
import android.view.ViewGroup;

public class NoteViewManager {
	private final Context context;
	private List<NoteView> noteViews;

	public NoteViewManager(Context context) {
		this.context = context;
		this.noteViews = new ArrayList<NoteView>();
	}

	public void AddNoteView(NoteView noteView) {
		if (noteViews.contains(noteView))
			return;
		noteViews.add(noteView);
		Activity activity = (Activity) context;
		((ViewGroup) activity.findViewById(android.R.id.content))
				.addView(noteView);
	}

	public void RemoveNoteView(NoteView noteView) {
		if (!noteViews.contains(noteView))
			return;
		noteViews.remove(noteView);
		Activity activity = (Activity) context;
		((ViewGroup) activity.findViewById(android.R.id.content))
				.removeView(noteView);
	}
}
